package com.sinosoft.ebusiness.domain.elementManage;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sinosoft.ebusiness.domain.elementManage.GeProduct;
import com.sinosoft.ebusiness.domain.elementManage.GeProductId;

@Entity
@Table(name = "GE_PRODUCT_INITEVENT")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class GeProductInitEvent {

	private GeProductId id;
	
	private String funName;
	
	private String funBody;
	
	private GeProduct geProduct;

	public GeProductInitEvent(){
		
	}
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "PRODUCTCODE", column = @Column(name = "PRODUCTCODE")),
			@AttributeOverride(name = "VERSION", column = @Column(name = "VERSION")) })
	public GeProductId getId() {
		return id;
	}

	public void setId(GeProductId id) {
		this.id = id;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public GeProduct getGeProduct() {
		return geProduct;
	}

	public void setGeProduct(GeProduct geProduct) {
		this.geProduct = geProduct;
	}

	@Column(name = "FUNNAME")
	public String getFunName() {
		return funName;
	}

	public void setFunName(String funName) {
		this.funName = funName;
	}

	@Column(name = "FUNBODY")
	public String getFunBody() {
		return funBody;
	}

	public void setFunBody(String funBody) {
		this.funBody = funBody;
	}
	
	
}
